package com.loklok.confuse.model;

import com.loklok.confuse.util.CommonUtil;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * @Classname ConfigSetting
 * @Description
 * @Date 2023/5/11 16:40
 * @author wangchangjiu
 */
public class CodePathConfig implements Serializable {

    private String codeAuthor;

    private String controllerPath;

    private String voPath;
    private String vmPath;

    private String requestPath;

    private String deepSeekApiKey;

    private String deepSeekVoVmPrompt;
    private String deepSeekDtoVmPrompt;
    private String deepSeekControllerVmPrompt;

    private String deepSeekPrompt;

    /**
     *  代码模板路径
     */
    private String codeTemplate;

    private String fullCodeJsonConfigPath;

    private String raisedCodeJsonConfigPath;

    private Integer batch;

    //private boolean enableFilterUsed;

    public String getCodeAuthor() {
        return codeAuthor;
    }

    public void setCodeAuthor(String codeAuthor) {
        this.codeAuthor = codeAuthor;
    }

    public String getControllerPath() {
        return controllerPath;
    }

    public void setControllerPath(String controllerPath) {
        this.controllerPath = controllerPath;
    }

    public String getVoPath() {
        return voPath;
    }

    public void setVoPath(String voPath) {
        this.voPath = voPath;
    }

    public String getVmPath() {
        return vmPath;
    }

    public void setVmPath(String vmPath) {
        this.vmPath = vmPath;
    }

    public String getRequestPath() {
        return requestPath;
    }

    public void setRequestPath(String requestPath) {
        this.requestPath = requestPath;
    }


    public String getDeepSeekApiKey() {
        return deepSeekApiKey;
    }

    public void setDeepSeekApiKey(String deepSeekApiKey) {
        this.deepSeekApiKey = deepSeekApiKey;
    }

    public String getDeepSeekVoVmPrompt() {
        return deepSeekVoVmPrompt;
    }

    public void setDeepSeekVoVmPrompt(String deepSeekVoVmPrompt) {
        this.deepSeekVoVmPrompt = deepSeekVoVmPrompt;
    }

    public String getDeepSeekDtoVmPrompt() {
        return deepSeekDtoVmPrompt;
    }

    public void setDeepSeekDtoVmPrompt(String deepSeekDtoVmPrompt) {
        this.deepSeekDtoVmPrompt = deepSeekDtoVmPrompt;
    }

    public String getDeepSeekControllerVmPrompt() {
        return deepSeekControllerVmPrompt;
    }

    public void setDeepSeekControllerVmPrompt(String deepSeekControllerVmPrompt) {
        this.deepSeekControllerVmPrompt = deepSeekControllerVmPrompt;
    }

    public Integer getBatch() {
        return batch;
    }

    public void setBatch(Integer batch) {
        this.batch = batch;
    }

    public String getDeepSeekPrompt() {
        return deepSeekPrompt;
    }

    public void setDeepSeekPrompt(String deepSeekPrompt) {
        this.deepSeekPrompt = deepSeekPrompt;
    }

    public String getRaisedCodeJsonConfigPath() {
        return raisedCodeJsonConfigPath;
    }

    public void setRaisedCodeJsonConfigPath(String raisedCodeJsonConfigPath) {
        this.raisedCodeJsonConfigPath = raisedCodeJsonConfigPath;
    }

    public String getCodeTemplate() {
        return codeTemplate;
    }

    public void setCodeTemplate(String codeTemplate) {
        this.codeTemplate = codeTemplate;
    }

    public String getFullCodeJsonConfigPath() {
        return fullCodeJsonConfigPath;
    }

    public void setFullCodeJsonConfigPath(String fullCodeJsonConfigPath) {
        this.fullCodeJsonConfigPath = fullCodeJsonConfigPath;
    }

    /*public boolean isEnableFilterUsed() {
        return enableFilterUsed;
    }

    public void setEnableFilterUsed(boolean enableFilterUsed) {
        this.enableFilterUsed = enableFilterUsed;
    }*/

    public List<ConfuseConfig.LoadFullCodeConfig> loadFullCodeConfigObj(){
        List<ConfuseConfig.LoadFullCodeConfig> configs = CommonUtil.loadFullCodeConfig(this.getFullCodeJsonConfigPath());
        return configs;
    }

    public List<ConfuseConfig.LoadRaisedCodeConfig> loadRaisedCodeConfigObj(){
        List<ConfuseConfig.LoadRaisedCodeConfig> configs = CommonUtil.loadRaisedCodeConfig(this.getRaisedCodeJsonConfigPath());
        return configs;
    }

    public boolean requiredFieldsEmpty() {
        return StringUtils.isEmpty(this.controllerPath)
                || StringUtils.isEmpty(this.voPath)
                || StringUtils.isEmpty(this.requestPath)
                || StringUtils.isEmpty(this.raisedCodeJsonConfigPath)
                || StringUtils.isEmpty(this.fullCodeJsonConfigPath)
                || StringUtils.isEmpty(this.deepSeekApiKey)
                || StringUtils.isEmpty(this.deepSeekPrompt);
    }
}
